﻿<UserControl x:Class="Rio.Manager.Application.Views.CustomerTabView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:conv="clr-namespace:Rio.Manager.Application.Converters"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:mvvmLightCommand="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             d:DesignHeight="1024"
             d:DesignWidth="168">
    
    <UserControl.Resources>
        <conv:ManageCustomerControlVisibility x:Key="ManageCustomerControlVisibility" />
    </UserControl.Resources>

    <UserControl.DataContext>
        <Binding Path="CustomerTab"
                 Source="{StaticResource Locator}" />
    </UserControl.DataContext>

    <Grid x:Name="LayoutRoot">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="Loaded">
                <mvvmLightCommand:EventToCommand Command="{Binding InitializationCommand}" />
            </i:EventTrigger>
        </i:Interaction.Triggers>
        <ContentControl x:Name="CustomerContent"
                        Content="{Binding AdministrationCustomerControl, Mode=TwoWay}" />
        <telerik:RadBusyIndicator IsBusy="True"
                                  IsIndeterminate="False"
                                  ProgressValue="{Binding LoadingPercent, Mode=TwoWay}"
                                  BusyContent="{Binding LoadingMessage, Mode=TwoWay}"
                                  Visibility="{Binding AdministrationCustomerControl, Converter={StaticResource ManageCustomerControlVisibility}, Mode=TwoWay}"/>
    </Grid>
</UserControl>
